import request from '@/config/axios'

export interface ReportVO {
  id: number
  status: number
  type: string
  content: string
  title: string
  gridId: number
  userId: number
  result: string
  rating: number
  evaluate: string
}

// 查询村情上报列表
export const getReportPage = async (params) => {
  return await request.get({ url: '/countryside/report/page', params })
}

// 查询村情上报详情
export const getReport = async (id: number) => {
  return await request.get({ url: '/countryside/report/get?id=' + id })
}

// 新增村情上报
export const createReport = async (data: ReportVO) => {
  return await request.post({ url: '/countryside/report/create', data })
}

// 修改村情上报
export const updateReport = async (data: ReportVO) => {
  return await request.put({ url: '/countryside/report/update', data })
}

// 删除村情上报
export const deleteReport = async (id: number) => {
  return await request.delete({ url: '/countryside/report/delete?id=' + id })
}

// 导出村情上报 Excel
export const exportReportApi = async (params) => {
  return await request.download({ url: '/countryside/report/export-excel', params })
}
